#ifndef BACKUP_THREAD_H
#define BACKUP_THREAD_H

#include <QThread>
#include <QFile>
#include "qmobex/qmobex.h"

class BackupThread : public QThread
{
    Q_OBJECT
public:
    explicit BackupThread(QMobex *mobex, QFile  *file, QByteArray phoneMemory, QObject *parent = 0);
    ~BackupThread();

signals:
    /*!
      Emited number of saved vCards to file.*/
      void saved(int);

public slots:
    /*!
      Abort current operation*/
    void abort();

protected:
    /*!
      Main function for this thread. As all QThread() run() functions invoked by BakcupThread::start() */
   void  run();

private:
   /*!
     Pointer to MObex class*/
    QMobex *mobex;

    /*!
      Destination file  where to place vCards*/
    QFile *file;

    /*!
      Memory to backup, PHONE or SIM.*/
    QByteArray memory;

    /*!
      Indicates that operation should be aborted.*/
      bool aborted;
};

#endif // BACKUP_THREAD_H
